import Login from '../pages/Login'
import Register from '../pages/Register'
import Home from '../pages/Home'
import Main from '../pages/subs/main/Main'
import Role from '../pages/subs/role/Role'
import User from '../pages/subs/user/User'
import Shop from "../pages/subs/shop/Shop"
import List from "../pages/subs/product/List"
import Category from "../pages/subs/product/Category"
import Salary from "../pages/subs/chart/Salary"
import Sales from "../pages/subs/chart/Sales"
import AddList from '../pages/subs/product/AddList'
import UpdateList from '../pages/subs/product/UpdateList'
import NotFind from "../pages/NotFind"
import RouterAuth from './RouterAuth'

const routes = [
    {
        index: true,
        element: <Login></Login>
    },
    {
        path: "/reg",
        element: <Register></Register>
    },
    {
        path: "/home",
        element: <RouterAuth>
             <Home></Home>
        </RouterAuth>,
        children: [
            {
                index: true,
                element: <Main></Main>
            },
            {
                path: "user",
                element: <User></User>
            },
            {
                path: "shop",
                element: <Shop></Shop>
            },
            {
                path: "role",
                element: <Role></Role>
            },
            {
                path: "list",
                element: <List></List>
            },
            {
                path: "category",
                element: <Category></Category>
            },
            {
                path: "addlist",
                element: <AddList></AddList>
            },
            {
                path: "updatelist",
                element: <UpdateList></UpdateList>
            },
            {
                path: "salary",
                element: <Salary></Salary>
            },
            {
                path: "sales",
                element: <Sales></Sales>
            }
        ]
    },
    {
        path: "*",
        element: <NotFind></NotFind>
    }
]

export default routes